<template>
  <div id='manage'>
    <div>
      &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
      开始时间：<Date-picker type="datetime" v-model="startDate" placeholder="选择日期和时间" style="width: 170px"></Date-picker>
      &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
      &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
      结束时间：<Date-picker type="datetime" v-model="endDate" placeholder="选择日期和时间" style="width: 170px"></Date-picker>
      &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
      &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
      <Button type="primary" @click="click">检索</Button>
    </div>
    <br/>
    <br/>
    <Table highlight-row ref="currentRowTable" :columns="columns3" :data="data1"></Table>
  </div>
</template>

<script>
import axios from 'axios'
export default {
  name: 'manage',
  components: {},
  props: {},
  data() {
    return {
      startDate: (() => {
        const date = new Date()
        date.setHours(0)
        date.setMinutes(0)
        date.setSeconds(0)
        return date
      })(),
      endDate: new Date(),
      columns3: [
          {
              type: 'index',
              width: 60,
              align: 'center',
              title: '序号',
          },
          {
              title: '机构',
              key: 'org'
          },
          {
              title: '发生时间',
              key: 'time'
          },
          {
              title: '级别',
              key: 'level'
          },
          {
              title: '类型',
              key: 'type'
          },
          {
              title: '处理情况',
              key: 'case'
          }
      ],
      data1: []
    }
  },
  computed: {},
  watch: {},
  methods: {
    click() {
      axios.get('/api/alarm/statistics').then(res => {
        this.data1 = res.data
      })
    }
  },
  created() {
  },
  mounted() { }
}
</script>

<style scoped>

</style>
